<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <script>
            // 解决了 setTimeout不能传参的问题

            // function fn1(x) {
            //     return function () {
            //         console.log(x);
            //     };
            // }
            // let fn2 = fn1(1);
            // setTimeout(fn2, 1000); // 1

            setTimeout((x) => {
                console.log(x);
            }, 1000); // undefined
        </script>
    </body>
</html>
